package com.hxzy.controller.admin;

import com.hxzy.common.vo.R;
import com.hxzy.dto.system.SysUserDTO;
import com.hxzy.entity.system.SysUser;
import com.hxzy.service.system.SysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "后台用户API")
@RestController
@RequestMapping(value = "/api/user")
public class SysUserController extends BaseController{

    @Autowired
    private SysUserService sysUserService;


    @PreAuthorize(value = "@ss.hasAuthority('system:user:list')")
    @ApiOperation("用户信息分页")
    @GetMapping(value = "/data")
    public R search(SysUserDTO sysUserDTO){
        super.startPageHelper();
        List<SysUser> page = this.sysUserService.search(sysUserDTO);
        return super.pageToPageVO(page);
    }

}
